package dfsketches.gr3d;

public class Player {
	protected Camera view;
	protected float angleY;
	protected float angleX;
	
	public Player(Camera cam, Vector3D pos, float facingAngle) {
		view = cam;
		view.setPosition(pos);
		angleY = facingAngle;
		angleX = 0f;
	}
	
	public void moveForward() {
		view.moveZ(-1f);
	}
	
	public void moveBackward() {
		view.moveZ(+1f);
	}
	
	public void moveLeft() {
		view.moveX(+1f);
	}
	
	public void moveRight() {
		view.moveX(-1f);
	}

	public void turnUp() {
		view.rotateX(+0.02f);
	}

	public void turnDown() {
		view.rotateX(-0.02f);
	}

	public void turnLeft() {
		angleY += 0.02f;
		view.rotateY(+0.02f);
	}

	public void turnRight() {
		angleY -= 0.02f;
		view.rotateY(-0.02f);
	}

	public void zoomOut() {
		view.setZoom(view.getZoom() * 0.8f);
	}
	
	public void zoomIn() {
		view.setZoom(view.getZoom() / 0.8f);
	}
	
}